﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="副本 SpatialSearch.aspx.cs" Inherits="SpatialSearch" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>实物地质资料中心--空间搜索</title>
    <link rel="shortcut icon" href="pic/mark.ico" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="css/spatialsearch.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/Utils.js"></script>
    <script src="http://api.map.baidu.com/api?v=1.4" type="text/javascript"></script>

    <script type="text/javascript">
        var mymap;
        function initialize() {
            mymap = new BMap.Map('map');
            mymap.centerAndZoom(new BMap.Point(110.404, 36.915), 5);
            mymap.addControl(new BMap.NavigationControl());
            mymap.addControl(new BMap.ScaleControl());
            mymap.addControl(new BMap.OverviewMapControl({ anchor: BMAP_ANCHOR_BOTTOM_RIGHT, offset: new BMap.Size(10, 10), isOpen: 1 }));

            var menu = new BMap.ContextMenu();
            var txtMenuItem = [
              {
                  text: '放大',
                  callback: function () { mymap.zoomIn() }
              },
              {
                  text: '缩小',
                  callback: function () { mymap.zoomOut() }
              },
              {
                  text: '放置到最大级',
                  callback: function () { mymap.setZoom(18) }
              },
              {
                  text: '查看全国',
                  callback: function () { mymap.setZoom(4) }
              }
            ];


            for (var i = 0; i < txtMenuItem.length; i++) {
                menu.addItem(new BMap.MenuItem(txtMenuItem[i].text, txtMenuItem[i].callback, 100));
                if (i == 1) {
                    menu.addSeparator();
                }
            }
            mymap.addContextMenu(menu);
            mymap.enableScrollWheelZoom();    //启用滚轮放大缩小，默认禁用
            mymap.enableContinuousZoom();    //启用地图惯性拖拽，默认禁用

        }
        function aclick(x, y, fileID, title, CollectAgens) {
            var point = new BMap.Point(Trans(y), Trans(x));
            mymap.panTo(point);
            var marker = new BMap.Marker(point);
            mymap.addOverlay(marker);

            mymap.centerAndZoom(point, 10);

            var opts = {
                width: 300,
                height: 70

            };
            //var ct='<a  href="GeoDataDetails.aspx?FID='+fileID+'" target="_blank" style="color:red">'+fileID+'</a>'+'<div style="font-size:12px">'+title+'+</div>';
            var ct = '<div style=" line-height:25px;font-size:14px;  ">档号：' + fileID + '<br/>题 名：' + title + '<br/>' + '<a  href="GeoDataDetails.aspx?FID=' + fileID + '"target="_blank" style="color:red;margin-left:200px;line-height:20px;font-size:15px;">>>详情</a></div>';
            var infoWindow = new BMap.InfoWindow(ct, opts);
            marker.openInfoWindow(infoWindow);

            document.getElementById("summary").innerHTML = "<table style='background:url(pic/spatialtips.png) no-repeat;width:400px; height:120px; padding-left:10px;'><tr><td >档号：" + fileID + "</td></tr> <tr><td>题名：" + title + "</td></tr><tr><td>形成单位：" + CollectAgens + "</td></tr></table>";

        }
        function Trans(value) {
            var a = Math.floor(value / 10000);
            var b = Math.floor(value % 10000 / 100);
            var c = Math.floor(value % 100);
            return a + (b + (c / 60)) / 60;
        }

        function rs() {
            divtomoveObj = document.getElementById("divtomove");
            divtomoveObj.style.posLeft = (document.body.clientWidth - divtomoveObj.offsetWidth) / 2;
        }

        function iFrameHeight() //定义IFrame的大小
        {
            var size = new Array();
            findDimensions(size);
            var bodyWidth = size[0];
            var bodyHeight = size[1];
            var bannerHeight = document.getElementById("header").offsetHeight;
            //var footHeight = document.getElementById("foot").offsetHeight;
            document.getElementById("content").style.height = (bodyHeight - bannerHeight) + "px";
            document.getElementById("map").style.height = document.getElementById("content").style.height;
            document.getElementById("map").style.width = bodyWidth - 380 + "px";
            document.getElementById("summary").style.width = bodyWidth - 480 + "px";
            document.getElementById("PageredHeight").style.height = (bodyHeight - bannerHeight - 60) + "px";
        }

        function findDimensions(size) //函数：获取尺寸
        {
            var winWidth = 0;
            var winHeight = 0;

            //获取窗口宽度
            if (window.innerWidth)
                winWidth = window.innerWidth;
            else if ((document.body) && (document.body.clientWidth))
                winWidth = document.body.clientWidth;
            //获取窗口高度
            if (window.innerHeight)
                winHeight = window.innerHeight;
            else if ((document.body) && (document.body.clientHeight))
                winHeight = document.body.clientHeight;

            //通过深入Document内部对body进行检测，获取窗口大小
            if (document.documentElement
               && document.documentElement.clientHeight
               && document.documentElement.clientWidth) {
                winHeight = document.documentElement.clientHeight;
                winWidth = document.documentElement.clientWidth;
            }

            //结果输出
            size[1] = winHeight;
            size[0] = winWidth;
        }

    </script>




</head>
<body onload="javascript:iFrameHeight();initialize();rs()">
    <div id="container">
        <form id="form1" runat="server">
            <div id="header">
                <p class="top_link"><a id="sy" href="index.aspx" style="color: #000; font-size: 15px;">返回首页</a> </p>
                <p class="logo"></p>
                <div class="searchBox">
                    <asp:TextBox ID="Titlename" CssClass="search_ipt" placeholder="请输入关键字、查询目录..." ImageAlign="Top" runat="server"></asp:TextBox>
                    <asp:ImageButton ID="SearchBtn" src="pic/searchsbtn.png" ImageAlign="Top" Height="29px" Width="65px" value="搜索" runat="server" OnClick="SearchBtn_Click" />


                    <input id="btn_HighSearch" class="search_btn2" type="button" onclick="window.location = 'Advanced_Search.aspx';" value="高级搜索" />

                </div>
            </div>


            <div id="content">
                <table cellspacing="0" cellpadding="0" style="width: 100%; table-layout: fixed;">
                    <tr>
                        <td width="380" valign="top">
                            <div class="tbl_head">档号&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题名 </div>
                            <div id="PageredHeight">
                                <asp:DataList ID="dl_FileList" runat="server" CssClass="tab1_content" Width="370">
                                    <ItemTemplate>
                                        <a id="DocFile" class="tbl2" href="javascript:void(0)"
                                            onclick="aclick(<%#Eval("START_LATITUDE")%>,<%#Eval("START_LONGITUDE")%>,'<%#Eval("FILE_ID")%>','<%#Eval("TITLE")%>','<%#Eval("GC_DEPART")%>')">[<%#Eval("FILE_ID")%>]&nbsp;&nbsp;&nbsp;&nbsp;<%#Eval("Title")%></a>
                                        <a href="GeoDataDetails.aspx?fid=<%#Eval("FILE_ID")%>" target="_blank" style="width: 10%; float: right; overflow: hidden; text-align: center; line-height: 30px;">详情</a>
                                    </ItemTemplate>
                                </asp:DataList>
                            </div>
                            <webdiyer:AspNetPager ID="AspNetPager1" CssClass="paginator" runat="server" PageSize="20" ShowBoxThreshold="1" AlwaysShow="True" FirstPageText="首页" LastPageText="末页" CurrentPageButtonClass="cpb"
                                NextPageText="下一页" PrevPageText="上一页" OnPageChanging="AspNetPager1_PageChanging" HorizontalAlign="Center">
                            </webdiyer:AspNetPager>


                        </td>
                        <td valign="top">
                            <div id="summary" style="height: auto; padding-top: 10px; line-height: 18px; left: 480px; color: red; position: absolute; font-family: '微软雅黑'; font-size: 13px; z-index: 100; overflow: hidden; text-align: left;"></div>
                            <div id="map" style="border: 0px solid #3F0;" marginwidth="0" marginheight="0" scrolling="no"></div>
                        </td>
                    </tr>
                </table>
            </div>
        </form>
    </div>
</body>
</html>
